package swingtest;

import java.awt.CardLayout;
import java.awt.Container;

import javax.swing.JButton;
import javax.swing.JFrame;

public class J_CardLayout {

	public static void main(String[] args) {
		JFrame app = new JFrame("J_CardLayout");
		app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		app.setSize(180, 100);

		Container container = app.getContentPane();
		CardLayout cardLayout = new CardLayout(5,5);
		container.setLayout(cardLayout);

		for (int i = 0; i < 5; i++) {
			JButton button = new JButton("button" + i);
			container.add(button, "button" + i);
		}

		cardLayout.show(container, "button1");
		cardLayout.next(container);

		app.setVisible(true);

	}

}
